//
//  NSString+JYJQCBase64.m
//  24_加密
//
//  Created by 冀永金 on 16/8/16.
//  Copyright © 2016年 KX. All rights reserved.
//

#import "NSString+JYJQCBase64.h"

@implementation NSString (JYJQCBase64)
- (NSString *)stingWithBase64{
    //  字符换转换成data
    NSData *stringData = [self dataUsingEncoding:NSUTF8StringEncoding];
    NSString *base64String = [stringData base64EncodedStringWithOptions: NSDataBase64Encoding64CharacterLineLength];
    return base64String;
}
// 解码
- (NSString *)base64WithString {
    // 根据Base64字符串  生成data
    NSData *base64Data = [[NSData alloc]initWithBase64EncodedString:self options:NSDataBase64DecodingIgnoreUnknownCharacters];
    NSString *orginString = [[NSString alloc]initWithData:base64Data encoding:NSUTF8StringEncoding];
    return orginString;
}

@end
